package com.mixsmart.spellsql.where;

import com.mixsmart.spellsql.IWhere;

/**
 * AndWrap实现类
 * @author lmq
 * @version 1.0
 * @since 1.0
 */
public class AndWrapWhere extends CompositeWhere {

	private IWhere leftCondition;
	
	private IWhere rightCondition;
	
	public AndWrapWhere(IWhere leftCondition, IWhere rightCondition) {
		this.leftCondition = leftCondition;
		this.rightCondition = rightCondition;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public String build() {	
		String conditionStr = leftCondition.build() + " and (" + rightCondition.build() + ")";
		super.addParameter(leftCondition, rightCondition);
		return conditionStr;
	}
	
}
